﻿using AttributeRouting.Web.Http;
//using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Water.Model;

namespace Water.RestService.Controllers
{
    public class PipeNetDamageLedgerController : ApiController
    {

        private PipeNetDamageLedgerQuery pndlq;
        private PipeNetDamageLedger pndl;
         
        [POST("GetPipeNetDamageLedgers")]
        public IList<PipeNetDamageLedgerQuery> PostGetPipeNetDamageLedgers(PipeNetDamageCondition pndc)
        {
            pndlq = new PipeNetDamageLedgerQuery();
            return pndlq.GetBridgePipeLedgers(pndc);
        }
        /*
        [POST("GetPipeNetDamageLedgersCount")]
        public int PostGetPipeNetDamageLedgersCount(PipeNetDamageLedger info)
        {
            var where = PipeNetDamageLedgerWhere(info);
            int count = rep.LoadCount(where);
            return count;
        }
        */
        
        [POST("AddPipeNetDamageLedger")]
        public bool PostAddPipeNetDamageLedger(PipeNetDamageLedger info)
        {
            info.MRNO = BuilderMrno.GetMrnoFortbl("Tbt_PipeNetDamageLedger");
            pndl = new PipeNetDamageLedger();
            bool result = pndl.AddPipeNetDamageLedger(info) > 0 ? true : false;
            return result;
        }
        /*
        [POST("EditPipeNetDamageLedger")]
        public bool PostEditPipeNetDamageLedger(PipeNetDamageLedger info)
        {
            bool result = rep.Edit(info);
            return result;
        }

        [GET("DeletePipeNetDamageLedger/{code}")]
        public bool GetDeletePipeNetDamageLedger(string code)
        {
            bool result = rep.Delete(code);
            return result;
        }

        [GET("GetPipeNetDamageLedger/{code}")]
        public PipeNetDamageLedger GetPipeNetDamageLedger(string code)
        {
            var result = rep.Get(code);
            return result;
        }
         * */
    }
}
